/* Modern Styles for railwayartwork.com */

/* 1. CSS Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

body, h1, h2, h3, p, figure, blockquote, dl, dd {
    margin: 0;
}

ul[role='list'], ol[role='list'] {
    list-style: none;
}

html:focus-within {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    line-height: 1.5;
    font-family: var(--font-main);
    color: var(--color-text);
    background-color: var(--color-bg);
}

a:not([class]) {
    text-decoration-skip-ink: auto;
}

img, picture {
    max-width: 100%;
    display: block;
}

input, button, textarea, select {
    font: inherit;
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 2. Global Variables */
:root {
    --color-primary: #333333; /* Darker for better contrast */
    --color-text: #555555;
    --color-link: #999999;
    --color-bg: #f9f9f9;
    --color-white: #ffffff;
    --font-main: Georgia, "Times New Roman", Times, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 1000px;
    --spacing: 1rem;
}

/* 3. Layout */
.container {
    width: 95%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing);
}

header {
    text-align: center;
    padding: 1rem 0;
}

header img {
    margin: 0 auto;
}

nav {
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    margin-bottom: 2rem;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

nav li {
    padding: 0.5rem 1rem;
}

nav a {
    text-decoration: none;
    color: var(--color-link);
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    display: block;
}

nav a:hover {
    color: var(--color-primary);
}

main {
    background-color: var(--color-white);
    padding: 2rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

/* 4. Responsive Gallery (Phase 3) */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.gallery-item {
    text-align: center;
}

.gallery-item img {
    width: 100%;
    height: auto;
    border: 5px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery-item p {
    margin-top: 0.5rem;
    font-style: italic;
}

/* 5. Mobile Adjustments */
@media (max-width: 600px) {
    nav ul {
        flex-direction: column;
    }
    nav li {
        border-bottom: 1px solid #eee;
        width: 100%;
    }
    nav li:last-child {
        border-bottom: none;
    }
    main {
        padding: 1rem;
    }
}
